import pandas as pd
pd.set_option('display.unicode.east_asian_width',True)
dfl=pd.DataFrame({'原时间信息':['02/28/2022 12:23:21','2022.02.28','2022/02/28','20220228','28-Feb-2022']})
df1['转换后的时间']=pd.to_datetime(dfl['原时间信息'])
print('时间的转换:\n',dfl)
df2=pd.DataFrame({'year':['2020','2021','2022'],
                  'month':['1','6','12'],
                  'day':['1','30','31'],
                  'hour':['1','13','18'],
                  'minute':['1','14','30'],
                  'sencond':['1','0','0']})
df2['组合后的时间']=pd.to_datetime(df2)
print('时间的组合:\n',df2)
df3=df2['组合后的时间']
df4=pd.DataFrame()
df4['年'],df4['月'],df4['日'],=df3.df.dt.year,df3.df.month,df3.dt.day
df4['时'],df4['分'],df4['秒'],=df3.df.dt.hour,df3.df.minute,df3.dt.second
df4['星期'],df4['季度']=df3.df.weekday+1,df3.dt.quarter
df4['是否年底'],df4['是否月底']=df3.dt.is_year_end,df3.dt.is_month_end
print('时间的提取:\n',df4)